package com.zsjp.alc;

import java.util.Properties;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import com.github.pagehelper.PageHelper;

@SpringBootApplication
public class AlcApplication {

	public static void main(String[] args) {
		SpringApplication.run(AlcApplication.class, args);
	}
	//配置mybatis的分页插件pageHelper
		@Bean
		public PageHelper pageHelper(){
			PageHelper pageHelper=new PageHelper();
			Properties properties=new Properties();
			properties.setProperty("offsetAsPageNum","true");
			properties.setProperty("rowBoundsWithCount","true");
			properties.setProperty("reasonable","true");
			//配置mysql数据库的方言
			properties.setProperty("dialect","mysql");
			pageHelper.setProperties(properties);
			return pageHelper;
		}

}
